<?php

use Faker\Factory;
use Illuminate\Database\Seeder;
use App\System\Cis\Model\CisUser;

class CisUserTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run(CisUser $cisUser)
    {
        //先清空表
        $cisUser->truncate();
        //实例化faker类
        $faker = Factory::create('zh_CN');//生成中文数据
        //循环
        for ($i = 0; $i < 30; $i++) {
            $cisUser->insert([
                'nickname'        => $faker->name,
                'org_id'          => mt_rand(1, 5),
                'share_image_ids' => 'null',
                'sex'             => mt_rand(0, 2),
                'sign'            => '这个人很懒，什么都没有留下。',
                'region_info'     => 'null',
                'image'           => '0',
                'status'          => mt_rand(1, 2),
                'user_type'       => mt_rand(0, 2),
                'created_at'      => date('Y-m-d H:i:s'),
                'mobile'          => $faker->PhoneNumber,
            ]);
        }
    }
}
